package com.kaibes.module.file.local.db;

import java.math.BigInteger;
import java.time.LocalDateTime;

import com.kaibes.core.base.annotation.Description;

import lombok.Data;

/**
CREATE TABLE `file_info` (
  `id` BIGINT NOT NULL AUTO_INCREMENT,
  `md5` CHAR(32) NOT NULL,
  `name` VARCHAR(128) NOT NULL,
  `suffix` VARCHAR(8) NOT NULL,
  `path` VARCHAR(128) NOT NULL,
  `type` VARCHAR(32) NOT NULL,
  `size` BIGINT UNSIGNED DEFAULT NULL,
  `access_count` INTEGER NOT NULL DEFAULT 0,
  `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `access_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `md5` (`md5`),
  UNIQUE KEY `path` (`path`)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 */
@Data
@Description("文件信息")
public class FileInfo {

    @Description("文件ID")
    private BigInteger id;
    @Description("文件MD5")
    private String md5;
    @Description("文件名字")
    private String name;
    @Description("文件后缀")
    private String suffix;
    @Description("文件路径")
    private String path;
    @Description("文件类型")
    private String type;
    @Description("文件大小")
    private long size;
    @Description("访问次数")
    private Integer accessCount;
    @Description("创建时间")
    private LocalDateTime createTime;
    @Description("最近访问")
    private LocalDateTime accessTime;
    
}
